package com.tim.spring;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;

import com.tim.source.db.SqlUtil;

public class ContentProc {
	public static void main(String[] args) {
		ApplicationContext content = null;
		content = new ClassPathXmlApplicationContext("applicationContext.xml");
		Object sqlUtil = content.getBean("sqlUtil");
		if (sqlUtil != null) {
			System.out.println("SqlUtil is not null");
		} else {
			System.out.println("SqlUtil is null");
		}
		Resource resource = new FileSystemResource("resource/applicationContext.xml");
		BeanFactory factory = new XmlBeanFactory(resource);
		if (factory.getBean("sqlUtil") != null)
			System.out.println("bean is not null");
	}
}
